package interview.juc;

public class Juc01Daemon {
    public static void main(String[] args) throws InterruptedException {
        /**
         * 用户线程结束，jvm结束
         * 存在用户线程，jvm不会结束
         */
        Thread aa = new Thread(() -> {
            System.out.println(Thread.currentThread().getName()+" type is Daemon? " + Thread.currentThread().isDaemon());
            while (true) {

            }
        }, "aa");
        aa.setDaemon(true);
        aa.start();
//        Thread.sleep(5000);
        System.out.println("main over , type is Daemon? "+ Thread.currentThread().isDaemon());
    }
}
